package com.bwie.controller;

import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: lrz
 * @Date: 2024/11/5 09:08
 * @Description:
 **/
@RestController
@RequestMapping("/user/user")
public class UserController {

    @Autowired
    UserService userService;

    /**
     * 获取手机验证码
     * @param loginInfoVo
     * @return
     */
    @PostMapping("/getCode/{phone}")
    public R getCode(@PathVariable("phone")String phone){
        return userService.getCode(phone);
    }

    @PostMapping("/login")
    public R login(@Validated @RequestBody LoginInfoVo loginInfoVo){
        return userService.login(loginInfoVo);
    }

}
